package com.kiln.juxingqs.alipayResult;

import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.kiln.juxingqs.R;

public class AliaPayEntryActivity extends Activity {

    private Button btn;
    private TextView errcodeView;
    private TextView errmsgView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_alipay);
        btn = findViewById(R.id.confirm_button_alipay);
        errcodeView = findViewById(R.id.pay_type_alipay_code);

        errmsgView = findViewById(R.id.pay_type_alipay_msg);

        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


        Bundle b = getIntent().getExtras();
        String resultInfo = b.getString("resultInfo");
        String resultStatus = b.getString("resultStatus");
        // 判断resultStatus 为9000则代表支付成功
        if (TextUtils.equals(resultStatus, "9000")) {
            errcodeView.setText(resultStatus+":"+R.string.pay_success );
            errmsgView.setText(resultInfo);

        } else {
            errcodeView.setText(resultStatus +""+R.string.pay_failed);
            errmsgView.setText(resultInfo);
        }


    }

}
